#include <QtGui/QApplication>
#include "workbench.h"
#include "scriptmanager.h"
#include "scriptapplication.h"
#include <QTextCodec>

#include <QMessageBox>
#include <QDebug>
int main(int argc, char *argv[])
{
    ScriptApplication app(argc, argv);

    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

#ifdef Q_OS_ANDROID
    app.setStyleSheet(
                      "* { font-size: 25px }"
                      "QTreeWidget::indicator { width: 30px; height:30px;}"
                      "QTreeWidget::item {width: 35px;height:45px;}"
                      "QHeaderView::section { width: 30px; height:30px; font: bold 25px;}"
                      "QTableView::item {width: 35px;height:45px;}"
                      "QScrollBar:vertical {border: 0px solid grey; width: 30px; margin: 30px 0px 30 0px;}"
                      "QScrollBar::add-line:vertical {height: 30px;subcontrol-position: bottom;subcontrol-origin: margin;}"
                      "QScrollBar::sub-line:vertical {height: 30px;subcontrol-position: top; subcontrol-origin: margin}"
                      "QRadioButton::indicator {width: 30px;height:30px;}"
                      "QCheckBox::indicator {width: 30px;height:30px;}"
                      "QScrollBar:horizontal {border: 0px solid grey; height: 30px; margin: 0px 30px 0px 30;}"
                      "QScrollBar::add-line:horizontal {width: 30px;subcontrol-position: right;subcontrol-origin: margin}"
                      "QScrollBar::sub-line:horizontal {width: 30px;subcontrol-position: left; subcontrol-origin: margin}"
                      "color: white; padding-left: 4px; border: 1px solid #6c6c6c;}"
                      );
    app.setDoubleClickInterval(700);
#endif

#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
    QString projectFile;
    if(argc > 1)
        projectFile = argv[1];
    app.loadProject(projectFile);
#else
    app.loadProject();
#endif

    return app.exec();
}
